package cn.itcast.mapper;

import cn.itcast.pojo.order;
import cn.itcast.pojo.orderItem;
import cn.itcast.pojo.orderItemExample;

import java.util.ArrayList;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface orderItemMapper {
    int countByExample(orderItemExample example);

    int deleteByExample(orderItemExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(orderItem record);

    int insertSelective(orderItem record);

    List<orderItem> selectByExample(orderItemExample example);

    orderItem selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") orderItem record, @Param("example") orderItemExample example);

    int updateByExample(@Param("record") orderItem record, @Param("example") orderItemExample example);

    int updateByPrimaryKeySelective(orderItem record);

    int updateByPrimaryKey(orderItem record);

    /**
     * explanation：根据骑手接单的所有orderid来统计骑手所有的订单中各商品的总重量和总金额
     * @param orderIds
     * @return
     */
    List<orderItem> selectPackageItemOrder(ArrayList<Integer> orderIds);

    /**
     * explanation：根据骑手接单的所有orderid来统计骑手所有的订单中各商品的总重量和总金额
     * @param ids
     * @return
     */
    List<orderItem> packageOrder(ArrayList<Integer> ids);

    /**
     * 根据订单id获取该订单所有的订单明细
     * @param orderId
     * @return
     */
    List<orderItem> getOrderItemByOrderId(Integer orderId);

    /**
     * 获取系统成交总重量
     * @return
     */
    Double getTotalWeight();

    /**
     * 获取五月份每日货量
     * @return
     */
    List<orderItem> getEverydayCommodity();

    /**
     * 获取回收总重量类型分布
     * @return
     */
    List<orderItem> getWeightDistribution();

    /**
     * 获取日最高货量
     * @return
     */
    List<orderItem> getMaxCommodity();


    /**
     *
     * @Description:  获取昨天下单的总重量和总金额
     *
     * @auther: 张松
     * @date: 11:49 2020/6/25
     * @param: []
     * @return: java.util.List<cn.itcast.pojo.order>
     *
     */
    List<orderItem> getYesterdayOrderWeightAndMoney();



    /**
     *
     * @Description:   获取昨天下单的分类重量和金额
     *
     * @auther: 张松
     * @date: 14:42 2020/6/29
     * @param: []
     * @return: java.util.List<cn.itcast.pojo.orderItem>
     *
     */
    List<orderItem> getYesterdayOrderWeightAndMoneyAndProductType();

    List<orderItem> getEverydayOrderWeightAndMoneyAndProductType(Integer everyDay);

    List<orderItem> findOrderId(@Param("orderId")Integer orderId);

    /**
     * 功能描述: <br>
     * 〈查看订单总重量〉
     * @Author: lyy
     * @Date: 2020/7/28 17:23
     * @Param: [orderId]
     * @Return: java.lang.Double
     */
    Double sumFinallyWeight(Integer orderId);


    List<orderItem> selectPrice(String openid);


    Integer selectHorsemanTodayAmount(String openid);


    Integer selectHorsemanYesterdayAmount(String openid);

}